<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
if($_RQ['op']=='edit'){
	$member=$this->pdo_get('member',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	$item['yajinfee']=$this->setting['fee_price'];
    $return['item']=$item;
	exi($return);
}
if($_RQ['op']=='post'){
	$member=$this->pdo_get('member',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	$postdata=get_postdata();
	$insert=array(
			'uniacid'=>$_SESSION['uniacid'],
			'mid'=>$_SESSION['uid'],
			'pid'=>$member['id'],
			'money'=>$this->setting['fee_price'],
			'createtime'=>TIMESTAMP,
	);
	pdo_insert('jy_wxshifu_mfee_log',$insert);
	$id=pdo_insertid();
	$params['fee']=$this->setting['fee_price'];
	$params['title']='师傅入驻';
	$params['id']=$id;
	$params['plugin']='jy_wxshifu';
	$params['back_url']='jy_wxshifu/apply/payresult/';
	$payid=cfc('pay')->create_pay_order($params);
	$this->pdo_update('mfee_log',array('pay_id'=>$payid),array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
	$res=array(
		'pay_id'=>$payid,
		'order_id'=>$id,
	);
	exi($res);
}
?>